#warrior abilities file
from abilities.base import *
import random

class Rend(DoT):
	def __init__(self,player):
		DoT.__init__(self,player)
		self.Name = 'rend'
	def calculateDamage(self,otherPlayer):
		self.Dmg = (random.randint(5,10) + (self.Player.Str / 4))
		return self.Dmg
	def setTime(self):
		return 4	
	def statChange(self,otherPlayer):
		return
	def removeStatChange(self,otherPlayer):
		return
	def upfrontDamage(self,otherPlayer):
		return 0

class IntimidatingShout(Debuff):
	def __init__(self,player):
		Debuff.__init__(self,player)
		self.Name = 'intimidating shout'
	def setTime(self):
		return 4
	def calculateDamage(self,otherPlayer):
		return 0
	def statChange(self,otherPlayer):
		self.PrevStr = self.Player.Str
		otherPlayer.Str /= 2
	def removeStatChange(self,otherPlayer):
		otherPlayer.Str = self.PrevStr
	def upfrontDamage(self,otherPlayer):
		return 0

class Slam(MeleeAbility):
	def __init__(self,player):
		Ability.__init__(self,player)
		self.Name = "slam"
	def calculateDamage(self,otherPlayer):
		self.Dmg = round((random.randint(5,15) + (self.Player.Str * 0.5)))
		return self.Dmg
	def addStun(self,otherPlayer):
		self.StunTime=2
		otherPlayer.stun(self.StunTime)
	def setCooldown(self):
		self.Cooldown = 2

class PiercingHowl(Debuff):
	def __init__(self,player):
		Debuff.__init__(self,player)
		self.Name = 'piercing howl'
	def setTime(self):
		return 7
	def statChange(self,otherPlayer):
		self.PrevStr = otherPlayer.Str
		self.PrevAgi = otherPlayer.Agi
		otherPlayer.Str -= otherPlayer.Str*.1
		otherPlayer.Agi -= otherPlayer.Agi*.1
	def calculateDamage(self,otherPlayer):
		return 0
	def setCooldown(self):
		self.Cooldown = 2
	def removeStatChange(self,otherPlayer):
		otherPlayer.Str = self.PrevStr
		otherPlayer.Agi = self.PrevAgi
	def upfrontDamage(self,otherPlayer):
		return 0
		
class MortalStrike(MeleeAbility):
	def __init__(self,player):
		Ability.__init__(self,player)
		self.Name = "mortal strike"
	def calculateDamage(self, player):
		self.Dmg = round(((random.randint(15,20) * (self.Player.Str / 1.25)) / 5))
		return self.Dmg
	def setCooldown(self):
		self.Cooldown=7
		
class Cleave(MeleeAbility):
	def __init__(self,player):
		Ability.__init__(self,player)
		self.Name = "cleave"
	def calculateDamage(self,otherPlayer):
		#Fill me in!
		return 3
	def isAOE(self):
		return True
	def setCooldown(self):
		self.Cooldown=0
		
